import * as CONSTANTS from '@/constants/index'
import request from '@/api/request'

export default {
  /**
   * 根据宝宝ID获取评测结果
   * @param {String,Number} babyId [必须]
   * @param {String,Number} pageNo [必须]
   * @param {String,Number} pageSize [必须]
   */
  [CONSTANTS.API_GET_HISTORYLIST]: (params) => {
    return request({
      url: `${CONSTANTS.API_BASEPREFIX}/v4/evaluation/get`,
      method: 'GET',
      params,
    })
  },
  /**
   * 上传评测结果
   * @param {String,Number} babyId [必须]
   * @param {String} role [非必须]
   * @param {String,Number} introspectionScore [非必须]
   * @param {String,Number} languageScore [非必须]
   * @param {String,Number} logicScore [非必须]
   * @param {String,Number} musicScore [非必须]
   * @param {String,Number} naturalScore [非必须]
   * @param {String,Number} relationshipScore [非必须]
   * @param {String,Number} spaceScore [非必须]
   * @param {String,Number} sportsScore [非必须]
   */
  [CONSTANTS.API_POST_QUIZRESULT]: (params) => {
    return request({
      url: `${CONSTANTS.API_BASEPREFIX}/v4/evaluation/add`,
      method: 'post',
      params: {
        ...params,
      },
    })
  },
  [CONSTANTS.API_GET_BABYASSESSCOUNT]: (params) => {
    return request({
      url: `${CONSTANTS.API_BASEPREFIX}/v4/evaluation/get-count-current-day`,
      method: 'get',
      params: {
        ...params,
      },
    })
  },
  [CONSTANTS.API_GET_RESULTBYITEMID]: (params) => {
    return request({
      url: `${CONSTANTS.API_BASEPREFIX}/v4/evaluation/get-by-id`,
      method: 'get',
      params: {
        ...params,
      },
    })
  },
}
